package com.anycl.customer.entity;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.util.StringUtils;

@Document(collection = "admin_user")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class AdminUser {

    @Id
    private String id;

    private String username;

    private String password;

    // 0 正常  1 禁止登录
    private Integer status;

    public AdminUser(String username, String password, Integer status) {
        this.username = username;
        this.password = password;
        this.status = status;
    }


    public boolean validate() {
        return !StringUtils.isEmpty(username) && !StringUtils.isEmpty(password);
    }
}
